<%@ page language="java"  pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title>MAKE IT EASY</title>
  <link type="text/css" rel="stylesheet" href="js/css/login.css" type="text/css"/>
  <script src='/mobilemall/js/easyui/jquery.min.js'></script>
  </head>
  
  
  <body>
  	 <div class='back'>
  	 <form method="post"  action='j_spring_security_check' >
  	 	<div id='ErrorTip'></div>
  	 	<div class='box'>
  	 	<input class='input' type="text" name="j_username" id="username"/>
  	 	<input class='input' type="password" name="j_password" id='password'>
  	 	<input class='input'  maxlength='4' type="text" name="j_verifycode" id='verifyCode' style='width:80px;'>
  	 	<img src="common/verify_graphCode.action" onclick="changeme(this)"
                     style="cursor:pointer;margin-bottom:-15px" title='点击换一张'/>
  	 	<div class='button' onclick='logon()'></div>
  	 	</div>
  	 </form>
  	 </div>		
  	 </div>
  	
  </body>
</html>

<script type="text/javascript">
	document.getElementById("username").focus();
	$(window).keydown(function(event){
		if(event.keyCode == 13)
			logon();	  
	});
	function logon(){
		if(check())document.forms[0].submit();
	}
	/*
     * 验证
     */
    function check() {
        var uname = document.getElementById('username').value;
        var pwd = document.getElementById('password').value;
        var code = document.getElementById('verifyCode').value;
        var tip='';
        var eo = document.getElementById('ErrorTip');        
        if(uname=="")
        	 tip += '用户名不能为空！<br>'
        if(pwd=="")
        	tip += '密码不能为空！<br>';
        if(code=="")
        	tip +='验证码不能为空！';
        if (!tip) {
            eo.style.display='none';
            return true;
        } else {
        	eo.innerHTML = tip;
            eo.style.display='block';
            return false;
        }
    }
    /*
     * 获取验证码
     */
    function changeme(obj) {
        obj.src = "/mobilemall/common/verify_graphCode.action?rnd=" + Math.random();
        document.getElementById('verifyCode').focus();
    }
  </script>